/* 
 * File:   Thread.h
 * Author: ben
 *
 * Created on November 11, 2012, 12:10 PM
 */

#ifndef THREAD_H
#define	THREAD_H

#include <pthread.h>
#include "Locker.h"

class Thread : public Locker {
private:
    /**
     * Class thread data member
     */
    pthread_t m_t;
    /**
     * Entry point for threads. Wrapper for run()
     * @param arg Thread to run
     * @return NULL
     */
    static void* thread_entrypoint(void* arg);
public:
    /**
     * Virtual method to be implemented by children, in this case Agent
     */
    virtual void run() = 0;
    /**
     * Creates a thread
     */
    void start();
};

#endif	/* THREAD_H */

